/**
 * Demo.java is created by Zachariah at 2012-2-14 下午04:19:43
 */
package com.zack.designPattern.memento;

/**
 * @author zachariah zzcfrog@gmail.com
 *
 */
public class Demo {

	/**
	 *
	 * @author zachariah
	 * @param args
	 */
	public static void main(String[] args) {
		Person p = new Person("zack",25);
		System.out.println(p.toString());
		MementoHolder mh = new MementoHolder();
		mh.saveMemento(p.createMemento());
		
		p.older();
		System.out.println(p.toString());
		
		p.restoreFromMemento(mh.getMemento());
		System.out.println(p.toString());
		
		
		
	}

}
